﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using netCoreStudy.Attr.QueryAttr;
using netCoreStudy.Entities.Base;

namespace netCoreStudy.Entities
{
	/// <summary>
	/// 角色
	/// </summary>
	public class Role : BaseEntity
	{
		/// <summary>
		/// 角色名
		/// </summary>
		public string Name { get; set; }

		/// <summary>
		/// 描述 
		/// </summary>
		public string Desc { get; set; }

		/// <summary>
		/// 等级 级别，数值越小，级别越大  
		/// </summary>
		public int OrderSort { get; set; } = 1;

		/// <summary>
		/// 是否激活
		/// </summary>
		public bool Enabled { get; set; }


		// /// <summary>
		// /// 多对多 用户 
		// /// </summary>
		// [Include(nameof(UserRole.User))]
		// public List<UserRole> UserRoles { get; set; }

		/// <summary>
		/// 多对多 菜单 
		/// </summary>
		[Include("RoleMenus.Menu")]
		public List<RoleMenu> RoleMenus { get; set; }
	}
}